//向文件写入数据
/**
package com.yootk;
import java.io.*;

public class YootkDemo {
    public static void main (String[] args) throws Exception{
        File file=new File("D:"+File.separator+"muyan"+File.separator+"vip"+File.separator+"yootk.txt");
        if (!file.getParentFile().exists()){
            file.getParentFile().mkdirs();
        }
        OutputStream output = new FileOutputStream(file);
        String message="www.yootk.com";
        byte date[]=message.getBytes();
        output.write(date);
        output.close();
    }
}
*/
//读取全部文件数据
/**
package com.yootk;
import java.io.*;

public class YootkDemo {
    public static void main (String[] args) throws Exception{
        File file=new File("D:"+File.separator+"muyan"+File.separator+"vip"+File.separator+"yootk.txt");
        if (file.exists()){
            try (InputStream input =new FileInputStream(file){
               byte data[]=new byte[1024];
               int len=input.read(date);
               System.out.println("读取到的数据内容【"+
                       new String(data,0,len)+"】");
            }catch(Exception e){}
        }

    }
 }
 */
//writer输出数据
/**
package com.yootk;
import java.io.*;

public class YootkDemo {
    public static void main (String[] args) throws Exception{
        File file=new File("D:"+File.separator+"muyan"+File.separator+"vip"+File.separator+"yootk.txt");
        if (!file.getParentFile().exists()){
            file.getParentFile().mkdirs();
        }
        try (Writer out=new FileWriter(file)){
            out.write("沐言科技：www.yootk.com\n");
            out.append("李新华编程训练营:edu.yootk.com");

        }catch (Exception e){}

        }
    }
 */
//reader数据读取
 /**
package com.yootk;
import java.io.*;

public class YootkDemo {
    public static void main(String[] args) throws Exception {
        File file = new File("D:" + File.separator + "muyan" + File.separator + "vip" + File.separator + "yootk.txt");
        if (file.exists()) {
            try (Reader in = new FileReader(file)) {
                char data[]=new char[1024];
                int len=in.read(data);
                System.out.println(new String(data,0,len));

            }catch (Exception e){}
        }
    }
}
*/